package org.myspringmvc.web.servlet.mvc;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.myspringmvc.web.bind.annotation.RequestMethod;

/**
 * @author 莫磊
 * @date 2025/8/14
 * @description 请求映射信息
 */
@Getter
@Setter
@ToString
public class RequestMappingInfo {

    private String requestURI;

    private RequestMethod requestMethod;

    @Override
    public boolean equals(Object obj) {
        RequestMappingInfo info = (RequestMappingInfo) obj;
        return this.requestURI.equals(info.getRequestURI())
                && requestMethod.equals(info.getRequestMethod());
    }

    @Override
    public int hashCode() {
        return requestURI.hashCode() + requestMethod.hashCode();
    }
}
